/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package hmvictor.jpql.types;

import java.util.Date;
import javax.swing.JComponent;
import org.jdesktop.swingx.JXDatePicker;

/**
 *
 * @author Victor
 */
public class DateEditor implements Editor<Date> {
    private final JXDatePicker datePicker=new JXDatePicker();

    @Override
    public JComponent getComponent() {
        return datePicker;
    }

    @Override
    public Date getValue() {
        return datePicker.getDate();
    }

    @Override
    public JComponent getComponent(Object initValue) {
        datePicker.setDate((Date) initValue);
        return datePicker;
    }
    
}
